using System;

namespace Sp.SuperWebHost.Logger
{
    class Logger : ILogger
    {
        public void LogError(Exception ex)
        {
            Console.WriteLine(ex);
        }

        public void LogError(Exception ex, string format, params object[] param)
        {
            Console.WriteLine(ex+string.Format(format,param));
        }

        public void LogInfo(string format, params object[] param)
        {
            if (param.Length==0)
            {
                Console.WriteLine(format);
            }
            else
            {
                Console.WriteLine(format, param);
            }
        }

        public void LogDebug(string format, params object[] param)
        {
#if DEBUG
            if (param.Length == 0)
            {
                Console.WriteLine(format);
            }
            else
            {
                Console.WriteLine(format, param);
            }
#endif
        }
    }
}